package com.ethink.warehouse.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.warehouse.api.info.WarehouseInfo;
import com.ethink.warehouse.api.request.WarehouseQueryRequest;
import com.ethink.warehouse.common.entity.Warehouse;
import java.util.List;
import org.apache.ibatis.annotations.Param;

/**
 * 仓库主仓 Mapper接口
 *
 * @author default
 * @date 2022-11-01
 */
@Mapper
public interface WarehouseMapper extends BaseMapper<Warehouse> {

    /**
     * 分页查询
     *
     * @param buildPage
     * @param request
     * @return
     */
    Page<WarehouseInfo> queryWarehouse(Page buildPage, @Param("request") WarehouseQueryRequest request);

    /**
     * 详情
     *
     * @param id
     * @return
     */
    WarehouseInfo getWarehouseById(@Param("id") Long id);

    /**
     * 根据分仓编码获取主仓详情
     *
     * @param subWarehouseCode
     * @return
     */
    WarehouseInfo getWarehouseBySubWarehouseCode(@Param("subWarehouseCode") String subWarehouseCode);

    /**
     * 列表查询
     *
     * @return
     */
    List<WarehouseInfo> listWarehouse();

}